import React from 'react'

// 创建函数组件
function Happy() {
  const HappyLog = (e) => {
    console.log(2222222,e)
  }
  return <div onClick={HappyLog}>this is Happy</div>
}

// 创建类组件
class Hello extends React.Component {
  log1 = (e,msg) => {
    console.log(11111,e,msg)
  }
  render() {
    return <div onClick={(e)=>this.log1(e,'dadd')}>this is Components</div>
  }
}

function App() {
  return (
    <div>
      <Hello />
      <Happy></Happy>
    </div>
  )
}

export default App
